﻿using ComicQ.Domain.Table;
using FluentNHibernate.Mapping;

namespace ComicQ.Domain.Mapping
{
    sealed class OrderMap : ClassMap<Order>
    {
        public OrderMap()
        {
            Id(x => x.Id);
            References(x => x.Member).Cascade.None();
            References(x => x.Staff).Cascade.None();
            Map(x => x.RentDate);
            Map(x => x.ReturnDate);
            References(x => x.Warranty).Cascade.None();
            Map(x => x.WarrantyNumber);
            Map(x => x.Total);
            References(x => x.OrderStatus).Cascade.None();
            HasMany(x => x.OrderDetails).Cascade.All().Inverse();
        }
    }
}
